# exerCise 1-3: tri anD tri again
# Write a triangle()
# function that will draw a triangle of a given “side length.”

from turtle import *
import turtle

# encapsulate with a function
def triangle(sides=3,sidelength=100, angle=120):
    # use a for loop
    for i in range(sides):
        forward(sidelength)
        right(angle)

# set speed and shape
shape('turtle')
speed(0)

# create a square
triangle()
triangle(sides=3,sidelength=100, angle=120) 
triangle(sides=4,sidelength=50, angle=90)

for count in range(50):
    triangle(sides=count,sidelength=50,angle=30)

turtle.exitonclick()